package com.zhangfb95.crosschain.sdk;

import com.zhangfb95.crosschain.infra.model.Result;
import com.zhangfb95.crosschain.sdk.infra.model.api.request.server.rpcchain.RpcQueryApiReq;
import com.zhangfb95.crosschain.sdk.infra.model.api.request.server.rpcchain.RpcSendApiReq;
import com.zhangfb95.crosschain.sdk.infra.model.api.request.server.rpcchainaccount.RpcChainAccountAddApiReq;
import com.zhangfb95.crosschain.sdk.infra.model.api.request.server.rpcchainaccount.RpcChainAccountAddPropertiesApiReq;
import com.zhangfb95.crosschain.sdk.infra.model.api.request.server.rpcchainaccount.RpcChainAccountListApiReq;
import com.zhangfb95.crosschain.sdk.infra.model.api.request.server.rpcchainaccount.RpcChainAccountRemoveApiReq;
import com.zhangfb95.crosschain.sdk.infra.model.api.request.server.rpcchainaccount.RpcChainAccountRemovePropertiesApiReq;
import com.zhangfb95.crosschain.sdk.infra.model.api.request.server.rpcuser.RpcUserUpdatePasswordApiReq;
import com.zhangfb95.crosschain.sdk.infra.model.api.request.server.rpcuser.RpcUserUpdateSecretApiReq;
import com.zhangfb95.crosschain.sdk.infra.model.api.request.server.rpcuser.RpcUserUpdateUsernameApiReq;
import com.zhangfb95.crosschain.sdk.infra.model.api.response.server.rpcchain.RpcGetBlockByNumberApiRes;
import com.zhangfb95.crosschain.sdk.infra.model.api.response.server.rpcchain.RpcGetHeightApiRes;
import com.zhangfb95.crosschain.sdk.infra.model.api.response.server.rpcchain.RpcGetTxByIdApiRes;
import com.zhangfb95.crosschain.sdk.infra.model.api.response.server.rpcchain.RpcListChainNameApiRes;
import com.zhangfb95.crosschain.sdk.infra.model.api.response.server.rpcchain.RpcListChainPathApiRes;
import com.zhangfb95.crosschain.sdk.infra.model.api.response.server.rpcchain.RpcQueryApiRes;
import com.zhangfb95.crosschain.sdk.infra.model.api.response.server.rpcchain.RpcSendApiRes;
import com.zhangfb95.crosschain.sdk.infra.model.api.response.server.rpcchainaccount.RpcChainAccountListApiRes;
import com.zhangfb95.crosschain.sdk.infra.model.api.response.server.rpcuser.RpcUserLoginApiRes;
import com.zhangfb95.crosschain.sdk.infra.model.service.dto.UserInfo;

/**
 * @author zhangfubing
 * @since 2023/12/19
 */
public interface CrossChainClient {

    Result<Void> add(String username, String decryptedPassword);

    Result<RpcUserLoginApiRes> login(String username, String decryptedPassword);

    UserInfo getLoginedUserInfo();

    UserInfo logout();

    Result<Void> updateUsername(RpcUserUpdateUsernameApiReq req);

    Result<Void> updatePassword(RpcUserUpdatePasswordApiReq req);

    Result<Void> updateSecret(RpcUserUpdateSecretApiReq req);

    Result<Void> addChainAccount(RpcChainAccountAddApiReq req);

    Result<Void> removeChainAccount(RpcChainAccountRemoveApiReq req);

    Result<RpcChainAccountListApiRes> listChainAccount(RpcChainAccountListApiReq req);

    Result<Void> addChainAccountProperties(RpcChainAccountAddPropertiesApiReq req);

    Result<Void> removeChainAccountProperties(RpcChainAccountRemovePropertiesApiReq req);

    Result<RpcListChainNameApiRes> listChainName();

    Result<RpcListChainPathApiRes> listChainPath();

    Result<RpcGetHeightApiRes> getHeight(String chainPath);

    Result<RpcGetBlockByNumberApiRes> getBlockByNumber(String chainPath, Long blockNumber);

    Result<RpcGetTxByIdApiRes> getTxById(String chainPath, String txId);

    Result<RpcQueryApiRes> query(RpcQueryApiReq req);

    Result<RpcSendApiRes> send(RpcSendApiReq req);
}
